import java.util.Scanner;
public class Test {

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int cnt1 = 30;//奇数
        int cnt2 = 31;//偶数
        while(cnt1 >= 0){
            System.out.print(n & (1 << cnt1));
            cnt1-=2;
        }
        System.out.println();
        while(cnt2 >= 0){
            System.out.print(n & (1 << cnt2));
            cnt2-=2;
        }
        System.out.println();
    }

    public static void main5(String[] args) {
        Scanner sc = new Scanner(System.in);
        int n = sc.nextInt();
        int cnt = 0;
        while(n != 0){
            if ((n & 1) == 1){
                cnt++;
            }
            n >>>= 1;
        }
        System.out.println(cnt);
    }

    public static void main4(String[] args) {
        int n = 0;
        Scanner sc = new Scanner(System.in);
        n = sc.nextInt();
        for (int i = 1; i <= n; i++){
            for (int j = 1; j <= i; j++){
                System.out.print(i+"*"+j+"="+i*j);
                System.out.print(" ");
            }
            System.out.println();
        }
    }

    public static void main3(String[] args) {
        int num = 1234565;
        int cnt = 0;
        Scanner sc = new Scanner(System.in);
        while (true){
            int tmp = sc.nextInt();
            if (tmp == num){
                System.out.println("登录成功");
                break;
            } else {
                cnt++;
                if (cnt > 2){
                    System.out.println("多次输入错误，退出登录");
                    return;
                }
                System.out.println("密码错误，请重新输入,还剩"+(3-cnt)+"次机会");
            }
        }

    }

    public static void main2(String[] args) {
        int a, b,r = 1;
        Scanner sc = new Scanner(System.in);
        a = sc.nextInt();
        b = sc.nextInt();
        if (a < b)
        {
            int tmp = a;
            a = b;
            b = tmp;
        }

        while (r != 0){
            r = a % b;
            b = a;
            a = r;
        }
        System.out.println(b);
    }

    public static void main1(String[] args) {
        for (int i = 0; i <= 999; i++)
        {
            int tmp = i;
            int sum = 0;
            while(tmp != 0){
                sum += (tmp % 10)*(tmp % 10)*(tmp % 10);
                tmp /= 10;
            }
            if (sum == i){
                System.out.println(i);
            }

        }
    }
}
